package com.ssy.lingxi.settle.accounts.controller;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.dto.request.CorporateAccountDetailRequest;
import com.ssy.lingxi.dto.response.CorporateAccountDetailResponse;
import com.ssy.lingxi.settle.accounts.model.vo.response.DropdownItemVO;
import com.ssy.lingxi.settle.accounts.service.ICommonService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

/**
 * @menu 结算能力-通用查询
 * @author 伍将
 * @date 2020/11/2
 * @version 2.0.0
 */
@RestController
@RequestMapping("/settle/accounts/common")
public class CommonController {

    @Resource
    private ICommonService commonService;

    /**
     * 获取结算单据类型
     * @author 伍将
     * @date 2020/11/2
     **/
    @RequestMapping(value = "/getSettlementOrderType", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getSettlementOrderType() {
        return commonService.getSettlementOrderType();
    }

    /**
     * 获取策略下结算单据类型
     * @author 伍将
     * @date 2020/11/2
     **/
    @RequestMapping(value = "/getStrategySettlementOrderType", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getStrategySettlementOrderType() {
        return commonService.getStrategySettlementOrderType();
    }

    /**
     * 获取平台策略下结算单据类型
     * @author 伍将
     * @date 2020/11/5
     **/
    @RequestMapping(value = "/getPlatformStrategySettlementOrderType", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getPlatformStrategySettlementOrderType() {
        return commonService.getPlatformStrategySettlementOrderType();
    }

    /**
     * 获取结算状态
     * @author 伍将
     * @date 2020/11/2
     **/
    @RequestMapping(value = "/getSettlementStatus", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getSettlementStatus() {
        return commonService.getSettlementStatus();
    }

    /**
     * 获取开票状态
     * @author 伍将
     * @date 2020/11/2
     **/
    @RequestMapping(value = "/getReceiptInvoiceStatus", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getReceiptInvoiceStatus() {
        return commonService.getReceiptInvoiceStatus();
    }

    /**
     * 获取支付状态
     * @author 伍将
     * @date 2020/11/2
     **/
    @RequestMapping(value = "/getPayStatus", method = RequestMethod.GET)
    public Wrapper<List<DropdownItemVO>> getPayStatus() {
        return commonService.getPayStatus();
    }

    /**
     * 查询对公(平台/会员)账户配置
     * @param request 查询条请求
     * @return 对公(平台/会员)账户配置
     */
    @RequestMapping(value = "/corporate/account/detail", method = RequestMethod.GET)
    public Wrapper<CorporateAccountDetailResponse> getCorporateAccountDetail(@Valid CorporateAccountDetailRequest request) {
        return commonService.getCorporateAccountDetail(request);
    }
}
